-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Tidus
-- Create date: 
-- Description:	BackUp
-- =============================================
USE QLNS
GO
/*
IF OBJECT_ID ('sp_BackUpData', 'p') IS NOT NULL
	DROP PROC sp_BackUpData
Go
CREATE PROCEDURE sp_BackUpData
	
AS
BEGIN
	SET NOCOUNT ON;
	SET XACT_ABORT ON;
	BEGIN TRANSACTION;
	BEGIN TRY
		
		COMMIT TRANSACTION
	END TRY
	BEGIN CATCH
		ROLLBACK TRANSACTION
	END CATCH
END
*/
GO
--
DECLARE @strDate varchar(50)
SELECT @strDate = CONVERT(varchar(50), GETDATE(), 104)
DECLARE @path nvarchar(500)
SET @path = 'D:\QLNS\Database\QLNS('+@strDate+').bak'
BACKUP DATABASE QLNS TO DISK = @path WITH INIT